package de.baumann.browser.activitys.oc

import android.content.Context
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import de.baumann.browser.R
import de.baumann.browser.base.BaseOdinActivity
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.db.ETHWallet
import de.baumann.browser.iview.IBaseView
import de.baumann.browser.utils.put
import de.baumann.browser.utils.web3j.OdinWallet
import de.baumann.browser.views.dialog.ScreenShotTipsDialog
import kotlinx.android.synthetic.main.activity_oc_backup_tips.*
import kotlinx.android.synthetic.main.include_tool_bar.*

class OcBackupTipsActivity : BaseOdinActivity<IBaseView, BasePresenter<IBaseView>>() {


    companion object {
        fun startOcBackupTipsActivity(context: Context, ethWallet: ETHWallet) {
            context.startActivity(Intent(context, OcBackupTipsActivity::class.java).apply {
                val bundle = Bundle().apply {
                    putSerializable("ethWallet", ethWallet)
                }
                putExtras(bundle)
            })
        }
    }

    override fun getLayout(): Int {
        OdinWallet.addAtivity(this)
        return R.layout.activity_oc_backup_tips
    }

    override fun initView() {
        initToolbar(commToolBar, null)
        btnBackupTips.setOnClickListener {
            ScreenShotTipsDialog(mContext, View.OnClickListener {
                val wallet = intent.getSerializableExtra("ethWallet") as ETHWallet
                OcMnemonicActivity.startOcMnemonicActivity(mContext,wallet)
                finish()
            }).show()
        }
    }

    override fun initData() {
    }

    override fun onDestroy() {
        super.onDestroy()
        OdinWallet.removeActivity(this)
    }

    override fun createPresenter(): BasePresenter<IBaseView>? {
        return null
    }

    override fun createView(): IBaseView? {
        return null
    }

    override fun showBindEth(): Boolean {
        return false
    }
}
